<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Loear admin</title>
    <meta name="author" content="SuggeElson" />
    <meta name="description" content="Supr admin template - new premium responsive admin template. This template is designed to help you build the site administration without losing valuable time.Template contains all the important functions which must have one backend system.Build on great twitter boostrap framework" />
    <meta name="keywords" content="admin, admin template, admin theme, responsive, responsive admin, responsive admin template, responsive theme, themeforest, 960 grid system, grid, grid theme, liquid, masonry, jquery, administration, administration template, administration theme, mobile, touch , responsive layout, boostrap, twitter boostrap" />
    <meta name="application-name" content="Supr admin template" />

    <!-- Mobile Specific Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- Force IE9 to render in normla mode -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- Le styles -->
    <link href="/static/css/bootstrap/bootstrap.css" rel="stylesheet" />
    <!--<link href="/static/css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />-->
    <link href="/static/css/supr-theme/jquery.ui.supr.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/icons.css" rel="stylesheet" type="text/css" />
    <link href="/static/plugins/forms/uniform/uniform.default.css" type="text/css" rel="stylesheet" />

    <!-- Main stylesheets -->
    <link href="/static/css/main.css" rel="stylesheet" type="text/css" />

    <!--[if IE 8]><link href="/static/css/ie8.css" rel="stylesheet" type="text/css" /><![endif]-->

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/js/libs/excanvas.min.js"></script>
    <script type="text/javascript" src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <script type="text/javascript" src="/static/js/libs/respond.min.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="/static/images/favicon.ico" />
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/images/apple-touch-icon-144-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/images/apple-touch-icon-114-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/images/apple-touch-icon-72-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" href="/static/images/apple-touch-icon-57-precomposed.png" />

    <script type="text/javascript" src="/static/js/libs/modernizr.js"></script>

</head>

<body class="loginPage">

<div class="container">

    <div id="header">

        <div class="row">

            <div class="navbar">
                <div class="container">
                    <a class="navbar-brand" href="dashboard.html">Loear.<span class="slogan">admin</span></a>
                </div>
            </div><!-- /navbar -->

        </div><!-- End .row -->

    </div><!-- End #header -->

</div><!-- End .container -->

<div class="container">

    <div class="loginContainer">
        <form class="form-horizontal" action="javascript:void(0);" id="loginForm" role="form" data-action="{:url('admin/Admin/loginProcess')}" data-refer_url="{$refer_url}">
            <div class="form-group">
                <label class="col-lg-12 control-label" for="username">用户名:</label>
                <div class="col-lg-12">
                    <input id="username" type="text" name="username" class="form-control" placeholder="请输入用户名">
                    <span class="icon16 icomoon-icon-user right gray marginR10"></span>
                </div>
            </div><!-- End .form-group  -->
            <div class="form-group">
                <label class="col-lg-12 control-label" for="password">密码:</label>
                <div class="col-lg-12">
                    <input id="password" type="password" name="password" placeholder="请输入密码" class="form-control">
                    <span class="icon16 icomoon-icon-lock right gray marginR10"></span>
                    <span class="forgot help-block"><a href="#">忘记密码?</a></span>
                </div>
            </div><!-- End .form-group  -->
            <div class="form-group">
                <div class="col-lg-12 clearfix form-actions">
                    <div class="checkbox left">
                        <label><input type="checkbox" id="keepLoged" value="Value" class="styled" name="logged" /> 记住密码</label>
                    </div>
                    <button type="submit" class="btn btn-info right" id="loginBtn"><span class="icon16 icomoon-icon-enter white"></span> 登录</button>
                </div>
            </div><!-- End .form-group  -->
        </form>
    </div>

</div><!-- End .container -->

<!-- Le javascript
================================================== -->
<script type="text/javascript" src="/static/js/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap/bootstrap.js"></script>
<script type="text/javascript" src="/static/plugins/forms/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="/static/plugins/forms/uniform/jquery.uniform.min.js"></script>

<script type="text/javascript" src="/static/plugins/forms/wizard/jquery.form.js"></script>

<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/plugins/layer/layer.js"></script>

<script type="text/javascript">
    // document ready function
    $(document).ready(function() {
        //------------- Options for Supr - admin tempalte -------------//
        /*var supr_Options = {
            rtl:false//activate rtl version with true
        }
        //rtl version
        if(supr_Options.rtl) {
            localStorage.setItem('rtl', 1);
            $('#bootstrap').attr('href', '/static/css/bootstrap/bootstrap.rtl.min.css');
            $('#bootstrap-responsive').attr('href', '/static/css/bootstrap/bootstrap-responsive.rtl.min.css');
            $('body').addClass('rtl');
            $('#sidebar').attr('id', 'sidebar-right');
            $('#sidebarbg').attr('id', 'sidebarbg-right');
            $('.collapseBtn').addClass('rightbar').removeClass('leftbar');
            $('#content').attr('id', 'content-one')
        } else {localStorage.setItem('rtl', 0);}*/

        $("input, textarea, select").not('.nostyle').uniform();
        $("#loginForm").validate({
            rules: {
                username: {
                    required: true,
                    minlength: 4
                },
                password: {
                    required: true,
                    minlength: 6
                }
            },
            messages: {
                username: {
                    required: "用户名不能为空",
                    minlength: "用户名不少于4个字符"
                },
                password: {
                    required: "密码不能为空",
                    minlength: "密码不能少于6位"
                }
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form) {
                $(form).ajaxSubmit({
                    type: 'post',
                    url: $(form).data('action'),
                    dataType: 'json',
                    data: {
                        "refer_url":$(form).data('refer_url')
                    },
                    success: function (response) {
                        if (response.status == 'success') {
                            location.href = response.url;
                        } else if (response.status == 'failed') {
                            layer.msg('添加失败', {icon: 2, time: 1000});
                        }
                    }, error: function (data) {
                        layer.msg('必填参数不能为空', {icon: 2, time: 1000});
                    }
                });
            }
        });
    });
</script>
</body>
</html>
